package com.example.studentportrait.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.studentportrait.domain.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * 角色信息表(Role)表数据库访问层
 *
 * @author makejava
 * @since 2023-10-17 21:18:32
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    List<String> selectRoleKeyByUserId(Long userId);
    @Select("SELECT role_name from role  r left join user_role  ur on r.id= ur.role_id where ur.account=#{account} ")
    String selectRoleNameByUserAccount(String account);
}

